package com.yang.commands;

import com.yang.YangSkills;
import com.yang.guis.YangGUI;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class YangSkillOpenCommand implements CommandExecutor {
    private static YangSkills yangSkills;
    public YangSkillOpenCommand(YangSkills yangSkills) {
        this.yangSkills = yangSkills;
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        //执行指令
        if(!label.equalsIgnoreCase("yangSkillOpen")){
            return true;
        }
//        if (args.length == 0){
//            return true;
//        }
        // 判断是否是玩家执行
        if (!(sender instanceof Player)) {
            return true;
        }
        sender.sendMessage("进入了");
        YangGUI.openStudyGui(((Player) sender).getPlayer());
        return true;
    }
}
